package com.emm.yixun.common.model.enums;

import org.apache.commons.lang.StringUtils;

public enum VersionEnum {
	VersionEnum_0(0,"拓展版"),
	VersionEnum_1(1,"启动会版"),
	VersionEnum_2(2,"方案版"),
	VersionEnum_3(3,"施工图版"),
	VersionEnum_4(4,"结算版"),
	VersionEnum_5(5,"经营计划版");
	private int code;
	private String value;
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	private VersionEnum(int code, String value) {
		this.code = code;
		this.value = value;
	}
	private VersionEnum() {
	}
	
	public static VersionEnum getByNo(int no) {
		
		for (VersionEnum menum : values()) {
			if (menum.getCode()==no) {
				return menum;
			}
		}
		return null;
	}
	
	public static VersionEnum getByDescription(String des) {
		if(StringUtils.isBlank(des)){
			return null;
		}
		for (VersionEnum menum : values()) {
			if (menum.getValue().equals(des)) {
				return menum;
			}
		}
		return null;
	}
	
	
}
